#include <iostream>
#include <mutex>


class Singleton
{
private:
    Singleton()
    {}
    Singleton(const Singleton& s) = delete;
    Singleton operator=(const Singleton& s) = delete;
public:
    static Singleton* GetInstance()
    {
        static Singleton _eton;
        return &_eton;
    }
};

class Singleton
{
private:
    Singleton()
    {}
    Singleton(const Singleton& s) = delete;
    Singleton operator=(const Singleton& s) = delete;
public:
    static Singleton* GetInstance()
    {
        static Singleton _eton;
        return &_eton;
    }
private:
    static Singleton _eton;
};
Singleton Singleton::_eton;


class Singleton1
{
private:
    Singleton1()
    {}
    Singleton1(const Singleton1& s) = delete;
    Singleton1 operator=(const Singleton1& s) = delete;
public:
    static Singleton1* GetInstance()
    {
        if(_pinst == nullptr)
        {
            // _lock.lock();
            std::unique_lock<std::mutex> lock(_lock);
            if(_pinst == nullptr)
            {
                _pinst = new Singleton1;
                return _pinst;
            }
            // _lock.unlock();
        }
    }
private:
    static Singleton1* _pinst;
    static std::mutex _lock;
};
Singleton1* Singleton1::_pinst = nullptr;
std::mutex Singleton1::_lock;

int main()
{

    return 0;
}